﻿@model List<DevFramework.Entities.Concrete.Category>

@{
    var categoryId =ViewContext.RouteData.Values["categoryId"];
}

<div class="list-group">
    <a class="list-group-item @(categoryId == null ? "active" : string.Empty)" href="/">@Word("Main.Category.All")</a>
    
    @foreach (var category in Model)
    {
        @Html.ActionLink(category.CategoryName, "Index", new { controller = "Product", categoryId = category.CategoryId }, new { @class = categoryId != null && categoryId.ToString() == category.CategoryId.ToString() ? "list-group-item active" : "list-group-item" })
    }
</div>
